const db = uniCloud.database()
const _ = db.command
module.exports = {
	_before: function() { // 通用预处理器

	},

	async operation(table, attr, id, num) {
		let obj = {}
		obj[attr] = _.inc(num)
		return await db.collection(table).doc(id).update(obj)
	}

}